package cn.jiangjiesheng.bootstrap.cloud.service;

import cn.hutool.json.JSONUtil;
import cn.jiangjiesheng.bootstrap.cloud.service.metadata.MetadataEndpoint;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.TestPropertySources;

import java.io.IOException;

@SpringBootTest(classes = CommonDemoApplication.class)
@TestPropertySources({
        @TestPropertySource("classpath:application.yaml"),
//        @TestPropertySource("classpath:bootstrap.yaml")
}
)
class MetadataEndpointTestSingleton {

    @Autowired
    private MetadataEndpoint appMetadataEndpoint;

    @Test
    void metadata() throws IOException, InterruptedException {
        System.out.println(JSONUtil.toJsonPrettyStr(appMetadataEndpoint.metadata()));
    }
}